//退出登录
import React from 'react';

import Config from '../../config';
import BaseAction from '../common/BaseAction';
import Constants from '../../common/Constants';
import Functions from '../../common/Functions';

//系统检测的退出登录
export default class LoginOutAction extends BaseAction {
  constructor() {
    super();

    this.moduleType = Constants.MODULE_TYPE.LOGIN;
    this.name = "LoginOutAction";
  }

  finish() {
    if(this.data && this.data.showAlert == false) {
      this.caller.gotoPage(Config.pages.login);
    }
    else {
      Functions.unauthorizationAlert(this.caller, this.data ? this.data.errorDetail : null);
    }
  }
}
